###
## @file makefile
## Betriebssysteme Makefile
## 
## Beispiel 1
##
## @author Markus Scharitzer 1410258040 <markus.scharitzer@technikum-wien.at>
## @date 2015/03/12
##
## @version 2.0 
##
## Makefile
##
###


##
## ------------------------------------------------------------- variables --
##

CC=gcc
CFLAGS=-DDEBUG -ggdb -Wall -pedantic -Werror -Wextra -Wstrict-prototypes -fno-common -g -O3
CP=cp
CD=cd
MV=mv
GREP=grep
DOXYGEN=doxygen

OBJECTS=myfind.o parser.o owner.o type.o print.o

EXCLUDE_PATTERN=footrulewidth

##
## ----------------------------------------------------------------- rules --
##

%.o: %.c
	$(CC) $(CFLAGS) -c $<

##
## --------------------------------------------------------------- targets --
##

all: myfind

myfind: $(OBJECTS)
	$(CC) $(CFLAGS) -o $@ $^

clean:
	$(RM) *.o *~ myfind

distclean: clean
	$(RM) -r doc

doc: html

html:
	$(DOXYGEN) doxygen.dcf

#pdf: html
#	$(CD) doc/pdf && \
#	$(MV) refman.tex refman_save.tex && \
#	$(GREP) -v $(EXCLUDE_PATTERN) refman_save.tex > refman.tex && \
#	$(RM) refman_save.tex && \
#	make && \
#	$(MV) refman.pdf refman.save && \
#	$(RM) *.pdf *.html *.tex *.aux *.sty *.log *.eps *.out *.ind *.idx \
#	      *.ilg *.toc *.tps Makefile && \
#	$(MV) refman.save refman.pdf
